//
//  setUpViewController.m
//  17DianYing
//
//  Created by apple on 15/9/5.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "setUpViewController.h"

@interface setUpViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *setUpTable;

@end

@implementation setUpViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.setUpTable.delegate = self;
    self.setUpTable.dataSource = self;
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0)
    {
        return 3;
    }
    return 4;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    UITableViewCell *cell = nil;
    NSString *identfier;
    
    if (indexPath.section == 0)
    {
        
        
        if (indexPath.row == 0)
        {
           identfier = @"setUpCell1";
        }
        else if (indexPath.row == 1)
        {
            identfier = @"setUpCell2";
        }
        else if (indexPath.row == 2)
        {
            identfier = @"setUpCell3";
        }
        cell = [tableView dequeueReusableCellWithIdentifier:identfier forIndexPath:indexPath];

    }
    
    
    if (indexPath.section == 1)
    {
        
        
        if (indexPath.row == 0)
        {
            identfier = @"setUpCell4";
        }
        else if (indexPath.row == 1)
        {
            identfier = @"setUpCell5";
        }
        else if (indexPath.row == 2)
        {
            identfier = @"setUpCell6";
        }
        else if (indexPath.row == 3)
        {
            identfier = @"setUpCell7";
        }
        cell = [tableView dequeueReusableCellWithIdentifier:identfier forIndexPath:indexPath];
    }
    return cell;
}
-(UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    self.setUpTable.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 5)];
    self.setUpTable.tableHeaderView.backgroundColor = [UIColor grayColor];
    
    return self.setUpTable.tableHeaderView;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
